package com.wyy.sbtest;

import com.wyy.testcontext.Service1;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

@SpringBootTest(classes = SbtestApplication.class)
class SbtestApplicationTests2 {

    @Autowired
    private ApplicationContext applicationContext;

    @Autowired
    private MyService myService;

    @Test
    void m1() {
        Assertions.assertThrows(BeansException.class, () -> {
            applicationContext.getBean(Service1.class);
        });

    }

}
